lapop12 = readRDS('data/lapop12.rds')
m1 = lm_robust(soc.cl_bin ~ trial + q1 + q2,
data = subset(lapop12, coup_support>0),
fixed_effects = estratopri + estratosec)
setwd("C:/Users/pedwards1/Dropbox/Argentina Project/_effects_of_tj_replication")
library(estimatr)
lapop12 = readRDS('data/lapop12.rds')
#### trimming exercise ####
m1 = lm_robust(soc.cl_bin ~ trial + q1 + q2,
data = subset(lapop12, coup_support>0),
fixed_effects = estratopri + estratosec)
m2 = lm_robust(torture_bin ~ trial + q1 + q2,
data = subset(lapop12, coup_support>0),
fixed_effects = estratopri + estratosec)
m3 = lm_robust(b1 ~ trial + q1 + q2,
data = subset(lapop12, coup_support>0),
fixed_effects = estratopri + estratosec)
texreg::texreg(list(m1, m2, m3), include.ci = F,
stars = c(.001, .01, .05, .1),
symbol = '\\dagger')
lapop12 = lapop12 %>%
mutate(
soc.cl_missing = as.numeric(is.na(soc.cl_bin) == TRUE, 1,0),
torture_bin_missing = as.numeric(is.na(torture_bin) == TRUE, 1,0),
fair_trial_missing = as.numeric(is.na(fair_trial) == TRUE, 1,0)
)
library(dplyr)
lapop12 = lapop12 %>%
mutate(
soc.cl_missing = as.numeric(is.na(soc.cl_bin) == TRUE, 1,0),
torture_bin_missing = as.numeric(is.na(torture_bin) == TRUE, 1,0),
fair_trial_missing = as.numeric(is.na(fair_trial) == TRUE, 1,0)
)
m1 = lm_robust(soc.cl_missing ~ trial + q1 + q2,
data = lapop12,
fixed_effects = estratopri + estratosec)
m2 = lm_robust(torture_bin_missing ~ trial + q1 + q2,
data = lapop12,
fixed_effects = estratopri + estratosec)
m3 = lm_robust(fair_trial_missing ~ trial + q1 + q2,
data = lapop12,
fixed_effects = estratopri + estratosec)
texreg::texreg(list(m1, m2, m3), include.ci = F,
stars = c(.001, .01, .05, .1),
symbol = '\\dagger')
#### Strata Table ####
strata <- lapop_df %>%
group_by(ur, estratopri, estratosec) %>%
summarise(n=n(),
treat = sum(treat))
#### Strata Table ####
strata <- lapop12 %>%
group_by(ur, estratopri, estratosec) %>%
summarise(n=n(),
treat = sum(treat))
#### Strata Table ####
strata <- lapop12 %>%
group_by(ur, estratopri, estratosec) %>%
summarise(n=n(),
treat = sum(trial))
strata$prop_treat <- strata$trial/strata$n
xtable(strata)
View(lapop12)
lapop12$trial
#### Strata Table ####
strata <- lapop12 %>%
group_by(ur, estratopri, estratosec) %>%
summarise(n=n(),
trial = sum(trial))
strata$prop_treat <- strata$trial/strata$n
library(xtable)
xtable(strata)
lapop12 = readRDS('data/lapop12.rds')
#appendix b2 (drop/recode march 26)
lapop12 = lapop12 %>%
mutate(trial2 = as.numeric(daten >= 326))
#social cleanse, recode march 26 as treated
b8.01 = lm_robust(soc.cl_bin ~ trial2,
data = lapop12,
fixed_effects = estratopri + estratosec,
se_type = 'stata')
b8.02 = lm_robust(soc.cl_bin ~ trial2 + I(trend-1) + weekend + q1 + q2,
data = lapop12,
fixed_effects = estratopri + estratosec,
se_type = 'stata')
b8.03 = lm_robust(soc.cl_bin ~ trial,
data= subset(lapop12, daten != 326),
fixed_effects = estratopri + estratosec,
se_type = 'stata')
b8.04 = lm_robust(soc.cl_bin ~ trial + trend + weekend + q1 + q2,
data = subset(lapop12, daten != 326),
fixed_effects = estratopri + estratosec,
se_type = 'stata')
#torture, recode march 26 as treated
b8.05 = lm_robust(torture_bin ~ trial2,
data = lapop12,
fixed_effects = estratopri + estratosec,
se_type = 'stata')
b8.06 = lm_robust(torture_bin ~ trial2 + I(trend-1) + weekend + q1 + q2,
data = lapop12,
fixed_effects = estratopri + estratosec,
se_type = 'stata')
#torture, mark march 26 as missing
b8.07 = lm_robust(torture_bin ~ trial,
data= subset(lapop12, daten != 326),
fixed_effects = estratopri + estratosec,
se_type = 'stata')
b8.08 = lm_robust(torture_bin ~ trial + trend + weekend + q1 + q2,
data = subset(lapop12, daten != 326),
fixed_effects = estratopri + estratosec,
se_type = 'stata')
#fair trial, recode march 26 as treated
b8.09 = lm_robust(fair_trial ~ trial2,
data = lapop12,
fixed_effects = estratopri + estratosec,
se_type = 'stata')
b8.10 = lm_robust(fair_trial ~ trial2 + I(trend-1) + weekend + q1 + q2,
data = lapop12,
fixed_effects = estratopri + estratosec,
se_type = 'stata')
#fair trial, mark march 26 as missing
b8.11 = lm_robust(fair_trial ~ trial,
data= subset(lapop12, daten != 326),
fixed_effects = estratopri + estratosec,
se_type = 'stata')
b8.12 = lm_robust(fair_trial ~ trial + trend + weekend + q1 + q2,
data = subset(lapop12, daten != 326),
fixed_effects = estratopri + estratosec,
se_type = 'stata')
texreg::texreg(list(b8.01, b8.02, b8.03, b8.04, b8.05, b8.06, b8.07, b8.08, b8.09, b8.10, b8.11, b8.12), include.ci = F,
stars = c(.001, .01, .05, .1),
symbol = '\\dagger')
#### Table 1 ---- Scope Conditions ####
setwd("~/Dropbox/Argentina Project/Data/Crossnational Transitional Justice Data")
setwd("C:/Users/pedwards1/Dropbox/Argentina Project/Data")
gwf <- read.dta13('GWFtscs.dta')
library(readstata13)
gwf <- read.dta13('GWFtscs.dta')
setwd("C:/Users/pedwards1/Dropbox/Argentina Project/Data")
gwf <- read.dta13('GWFtscs.dta')
setwd("C:/Users/pedwards1/Dropbox/Argentina Project/Data/Crossnational Transitional Justice Data")
gwf <- read.dta13('GWFtscs.dta')
gwf <- gwf %>%
group_by(cowcode, gwf_country) %>%
summarise(gwf_military = mean(gwf_military))
gwf$ever_military <- as.numeric(gwf$gwf_military > 0, 1,0)
colnames(gwf)[1] <- 'ccode'
justice <- read.dta13('Sikkink et al. barsbargains.dta')
justice <- justice %>%
group_by(ccode) %>%
summarise(tj = mean(tj, na.rm = T))
scope <- merge(justice, gwf, by = 'ccode')
scope <- subset(scope, tj > 0)
scope <- subset(scope, ever_military == 1)
scope <- scope[ ,c('gwf_country', "gwf_military", "tj", "ccode")]
colnames(scope)[1:3] <- c('Country', 'Pct. Military Dictatorship Years', 'Pct. Transitional Justice Years')
#require(xtable)
xtable(scope)
justice <- read.dta13('Sikkink et al. barsbargains.dta')
justice_2 <- merge(gwf, justice, by = c('ccode'), all = TRUE)
justice_2 <- subset(justice_2, ever_military == 1)
justice_2 <- subset(justice_2, tj == 1)
justice_3 <- justice_2 %>%
group_by(ccode) %>%
mutate(min_year = min(year),
max_year = max(year))
justice_3$ever_military <- 1
#### Last Year of military dictatorship
gwf <- read.dta13('GWFtscs.dta')
colnames(gwf)[1] <- 'ccode'
gwf2 <- subset(gwf, gwf_military == 1)
gwf2 <- gwf2 %>%
group_by(ccode, gwf_country) %>%
summarize(min_year = min(year),
max_year = max(year))
colnames(gwf2)[3:4] <- c('min_mil_year', 'max_mil_year')
justice <- read.dta13('Sikkink et al. barsbargains.dta')
justice <- subset(justice, tj == 1)
justice <- justice %>%
group_by(ccode) %>%
summarise(min_year_tj = min(year))
scope <- merge(justice, gwf2, by = 'ccode')
scope$tj_time <- scope$min_year_tj - scope$max_mil_year
scope <- subset(scope, tj_time > -1)
scope <- scope[ ,c("gwf_country", "max_mil_year", 'min_year_tj', "tj_time")]
colnames(scope)[1:4] <- c('Country', 'Last Year Mil. Dictatorship', "First Year TJ", 'Time Until TJ')
require(xtable)
scope <- scope[order(scope$Country),]
scope
scope$`First Year TJ` <- as.character(scope$`First Year TJ`)
scope$`Time Until TJ` <- as.character(scope$`Time Until TJ`)
xtable(scope)
scope <- scope[order(scope$Country),]
scope
View(scope)
write.csv(scope,"scope-conditions.csv", row.names = FALSE)
setwd("C:/Users/pedwards1/Dropbox/Argentina Project/_effects_of_tj_replication/data")
####scope conditions####
scope <- read.csv("scope-conditions.csv")
scope <- scope[order(scope$Country),]
scope
scope$`First Year TJ` <- as.character(scope$`First Year TJ`)
####scope conditions####
scope <- read.csv("scope-conditions.csv")
View(scope)
xtable(scope)
xtable(scope)
